﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

using Joyintech.Common;
using Joyintech.Model.inpiao365;
using Joyintech.BLL.inpiao365;

namespace Joyintech.Admin.inpiao365.general.dianin.manage
{
    public partial class index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                //绑定列表
                DataBindmovie();
            }
        }


        protected void btnSearch_Click(object sender, EventArgs e)
        {
            DataBindmovie();
        }

        private void DataBindmovie()
        {
            StringBuilder strSql = new StringBuilder();

            if (this.txtmovieName.Text.Trim() != "")
            {
                strSql.Append(" and movieName like '%" + this.txtmovieName.Text.Trim() + "%'");
            }
            
            this.SqlPager1.CurrentPageIndex = 0;
            this.SqlPager1.ConnStringKeyName = "localServer";
            this.SqlPager1.SelectCommand = "*";
            this.SqlPager1.SelectCommandTable = "movie";
            this.SqlPager1.SelectCommandWhere = "1=1" + strSql.ToString();
            this.SqlPager1.SortField = "movieId desc";
            this.SqlPager1.SortStyle = WebControls.SortMode.DESC;
            this.SqlPager1.DataBind();
        }

    }
}